﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;

namespace CrawlClassProofs
{
    class Program
    {
        static void Main(string[] args)
        {
            StreamReader reader = new StreamReader(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Text.txt"));
            string content = reader.ReadToEnd();
            reader.Close();

            Regex parser = new Regex(@"\[(\d+),", RegexOptions.IgnoreCase);

            MatchCollection matches = parser.Matches(content);
            foreach (Match m in matches)
            {
                string id = m.Groups[1].Value;

                File.AppendAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Out.txt"), String.Format("ClassProofs[\"{0}\"] = UnitClass.Druid;\r\n", id));
            }
        }
    }
}
